﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SingletonSample
{
    public static class Singleton
    {
        private static readonly object Lock = new object();
        private static Session _session;

        public static Session CurrentSession
        {
            get
            {
                if (_session == null) lock (Lock)
                        if (_session == null)
                        {
                            _session = new Session();
                        }

                return _session;
            }
        }
    }
}
